import React,{Component,lazy,Suspense} from 'react';
import logo from './logo.svg';
import './App.css';

class Foo extends Component {
   shouldComponentUpdate(nextProps,nextState) {
      if (nextProps.name === this.props.name) {
        return false;
      }
      return true;
    }
  render() {

    console.log('Foo Component')
    return null
  }
}
class App extends Component {
  state = {
    count: 1
  }
  render() {
    return (
        <div>
          <button
            onClick={() => this.setState({count: this.state.count + 1})}
          >
          叠加
          </button>
          <Foo name='Foo'></Foo>
        </div>

      );
  }
}

export default App;
